#include "mylistwidget.h"

MyListWidget::MyListWidget(QWidget *parent)
    : QListWidget(parent)
{
    m_vscrollBar = verticalScrollBar(); // 保持垂直滚动条
    connect(m_vscrollBar, SIGNAL(valueChanged(int)), this, SLOT(onSliderChanged(int)));
}

void MyListWidget::onSliderChanged(int p)
{
    int startRow = count();
    if (p == m_vscrollBar->maximum())
    {
        //QMessageBox::information(this, "Warning", "You reached the bottom of the vertical scroll bar!");
        emit reachedBottom(); // 1
    }
    emit mysliderChanged(p);  // 2
}
